import time

import requests
def myfunc():
    s=requests.session()
    url="http://127.0.0.1:9999/woniusales/user/login"
    data={"username":"admin","password":"admin123","verifycode":"0000"}
    r=s.post(url,data)
    print(r.status_code)
    print(r.headers)
    print(r.text)
    # 
    # r=s.post("http://127.0.0.1:9191/woniusales/customer/search")
    # print(r.status_code)
    # print(r.headers)
    # print(r.text)

    # add_data={"customername":"小乔","customerphone":"15811111113","childsex":"男","childdate":"2020-09-27","creditkids":"3","creditcloth":"3"}
    # r=s.post("http://127.0.0.1:9191/woniusales/customer/add",data=add_data)
    # print(r.status_code)
    # print(r.headers)
    # print(r.text)
    # #
    # r=s.post("http://127.0.0.1:9191/woniusales/goods/upload",data={"batchname":"GB2020092701"},files={"batchfile":open(r"C:\testwoniusales.xls","rb")})
    # print(r.status_code)
    # print(r.headers)
    # print(r.text)
    #

    # r = s.get("http://127.0.0.1:9191/woniusales/user/logout", allow_redirects=False)  # 有的时候不希望跟随重新下？ 设置 【allow_redirects=False】
    # print(r.status_code)
    # print(r.headers)
    # print(r.text)

myfunc()
